package cn._2dland.uploader.sixrooms;

import cn._2dland.uploader.UploadTask;

public class SixRoomsTask extends UploadTask {
	public int cid;
	public int status;

	public boolean forceFLVX = false;

	public String getFileName(){
		// 文件为空或不存在时，直接返回
		if(file==null || !file.exists())
			return null;

		// 获取原始文件名
		String fileName = file.getName();
		if(forceFLVX)
			fileName = fileName.substring(0, fileName.lastIndexOf('.')) + ".flvx";
		return fileName;
	}

	public void deleteFile() {
		if(file==null || !file.exists())
			return;

		// 删除文件
		try{
			if(!file.delete())
				throw new Exception();
		}
		catch (Exception e) {
			file.deleteOnExit();
		}
	}
}
